import pymysql as pymysql
db = pymysql.connect(
    host="localhost",
    port =3306,
    user = "root",
    database = "crawlerdemo",
    password= "222700360Wlq",
    charset= "utf8"
)
cursor = db.cursor()
cursor.execute("select * from m_stu")
print(cursor)
#fetchone()
#data = cursor.fetchone()
#fetchall()
data = cursor.fetchall()
#print("当前数据库版本：%s" % data)
#print(data)
cursor.close()
db.close()